<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/axios.js"></script>
</head>
<body>
    <button id="btn1">发送</button>
    <script>
        var btn1 = document.querySelector('#btn1');
        btn1.addEventListener('click',function(){
            var url = 'http://www.liulongbin.top:3006/api/get';
            var paramsObj = {name:'zhx',age:20};
            // axios.get(url,{params:paramsObj}).then(function(res){
            //     console.log(res.data);
            // })
            // get:params post:data
            axios({
                method:'get',
                url:'http://www.liulongbin.top:3006/api/get',
                params:paramsObj
            }).then(function(res){
                console.log(res);
            })
        })
    </script>
</body>
</html>